-- GENERATED SPELL FOR [Vrykul Necrolord] --


function spell0_31783(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(9613,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_31783', 3000, 1)
end

function spell1_31783(pUnit, Event) --@Shadow Nova,Self--
pUnit:FullCastSpellOnTarget(32712,pUnit)
pUnit:RegisterEvent('Sorts_31783', 567, 1)
end

function spell2_31783(pUnit, Event) --@Tug Soul,Drain--
pUnit:FullCastSpellOnTarget(50027,pUnit:GetRandomPlayer(0))
pUnit:RegisterEvent('Sorts_31783', 12000, 1)
end

function Sorts_31783(pUnit, Event)
local choix_sorts_31783 = math.random(0, 2)
if choix_sorts_31783 == 0 then
pUnit:RegisterEvent('spell0_31783', 1, 1)
end
if choix_sorts_31783 == 1 then
pUnit:RegisterEvent('spell1_31783', 1, 1)
end
if choix_sorts_31783 == 2 then
pUnit:RegisterEvent('spell2_31783', 1, 1)
end
end

function mob31783_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_31783', math.random(1500, 3000), 1)
end

function mob31783_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob31783_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob31783_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(31783, 1, 'mob31783_Action')
RegisterUnitEvent(31783, 2, 'mob31783_Leave')
RegisterUnitEvent(31783, 3, 'mob31783_Kill')
RegisterUnitEvent(31783, 4, 'mob31783_Die')
